package com.xcroot.chapter04;

/**
 * Created by CRoot on 2017/10/12.
 */
public class ArrayTest {
    public static void main(String[] args) {
        int NumArray[] = {2, 3, 6, 45, 6, 45, 68, 44, 63};
        int one = 68;
        int count = 0;//相同数值 计次
        for (int i = 0; i < NumArray.length; i++) {
            if(NumArray[i] == one ){
                System.out.println("该数字在第" + (i + 1) + "位");
                count++;
            }
            if(count == 0 && i == NumArray.length - 1)
                System.out.println("没有找到该数字");
        }
    }
}
